{% extends 'base.html' %}

{% block title %}
	{{ page }}
{% endblock %}

{% block menu %}
	<div class="menu">
	<table id="main_menu">
	<tr>
	{% for key, value in menus.items() %}
		<td>
		<a href= "{{url_for(key)}}" >
            <h2>{{ value }}</h2>
        </a>
		</td>
	{% endfor %}
	</tr>
	</table>
	</div>
{% endblock %}

{% block container %}
	<div class="container">
    	<h1> {{ page }} </h1>
	</div>
	<div>
		<h2> {{ text2 }} </h>
	</div>
	<div>
		<h2> {{ text }} </h2>
	</div>
<div class="form">
<form method="post">
{{ cDMX.csrf_token() }}
{% if 'select_device' in form %}
	<div>
		{{ cDMX.list_device.label }}
		{{ cDMX.list_device }}
	</div>
	<div>
		{{ cDMX.select_device }}
	</div>
{% elif 'control_device' in form and 'dimmer' in mode %}
	{% for dmx in data %}
	<label for="{{dmx.0}}">{{dmx.1}}:</label><input type="range" name="{{ dmx.0 }}" min="0" max="255" step="1" value="{{ host.get_dmx_val(host.read_conf('default', 'preset'), dmx.0) }}"></input><br>
	{% endfor %}
	<div>
	{{ cDMX.save_dmx}}
	{{ cDMX.finish_control }}
	</div>
{% elif 'control_device' in form and 'switch' in mode %}
	{% for dmx in data %}
	<label for="{{dmx.0}}">{{dmx.1}}: &nbsp &nbsp вкл</label><input type="radio" name="{{ dmx.0 }}" value="255" {% if host.get_dmx_val(host.read_conf('default', 'preset'), dmx.0)|int >= 127 %} checked{% endif %}></input>
	<label for="{{dmx.0}}">выкл</label><input type="radio" name="{{ dmx.0 }}" value="0" {% if host.get_dmx_val(host.read_conf('default', 'preset'), dmx.0)|int <= 126 %} checked {% endif %}></input><br>
	{% endfor %}
	<div>
	{{ cDMX.save_dmx}}
	{{ cDMX.finish_control }}
	</div>
{% endif %}
</form>
{% if 'admin' in f %}
<br><br><hr>
<form method="post">
{{ fBl.csrf_token() }}
<p>Сбросить все значения DMX на ноль</p>
<div>
	{{ fBl.black }}
</div>
</form>
{% endif %}
</div>
{% endblock %}

{% block content %}
{% endblock %}

{% block foot %}
	<div class="foot">
		<a>
		{% for txt in foot %}
			{{ txt }}
			<br>
		{% endfor %}
		</a>
		<a href="{{ url }}" target="_blank">Сайт проекта</a>
	</div>
{% endblock %}

